#ifndef _OHAI_PASSWORD_H_
#define _OHAI_PASSWORD_H_

/* Get a password from the user.
 *
 * Copyright 2008 Cian Synnott.
 * 
 * $Id: password.h 19 2009-11-27 20:46:48Z cian $
 */

/* Toggles echo on your terminal. */
void toggle_echo(void);

/* Gets a password from the user with a prompt.
 *
 * The returned password is allocated on the heap; the caller must free() it.
 *
 * Args:
 * - prompt: a printf-style prompt format to print before turning echo off
 * - ... : arguments to be interpolated into prompt
 * Returns:
 * - a password on success, or NULL on failure
 */
char *get_password(char *prompt, ...);

#endif /* _OHAI_PASSWORD_H_ */
